load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

cc_binary(
    name = "cp1-add",
    srcs = ["cp1_1.2_add.cpp"],
)

cc_binary(
    name = "cp1-comment",
    srcs = ["cp1_1.3_comment.cpp"],
)

cc_binary(
    name = "cp1-while",
    srcs = ["cp1_1.4.1_while.cpp"],
)

cc_binary(
    name = "cp1-for",
    srcs = ["cp1_1.4.2_for.cpp"],
)

cc_binary(
    name = "cp1-while-read",
    srcs = ["cp1_1.4.3_while_read.cpp"],
)

cc_binary(
    name = "cp1-while-count",
    srcs = ["cp1_1.4.4_while_count.cpp"],
)

##注意看这个和下一个的比较，对于引入外部类，在同一个BUILD(相同文件夹内)，即可以用源码编译两个类，也可以通过cc_library编译成外部库依赖进来
cc_binary(
    name = "cp1-rw-sales-item",
    srcs = ["cp1_1.5.1.1_rw_sales_item.cpp", "Sales_item.h"],
)

cc_library(
    name = "Sales-item",
    srcs = ["Sales_item.h"],
)

cc_binary(
    name = "cp1-ddd-two-sales-item",
    srcs = ["cp1_1.5.1.2_add_two_sales_item.cpp", "Sales_item.h"],
    deps = [":Sales-item"],
)

cc_binary(
    name = "cp1-add-two-sales-item-with-check",
    srcs = ["cp1_1.5.2_add_two_sales_item_with_check.cpp", "Sales_item.h"],
)

cc_binary(
    name = "cp1-book-store",
    srcs = ["cp1_1.6_book_store_program.cpp", "Sales_item.h"],
)